<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="public::head('投票表决')">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8"></meta>

</head>
<body style="padding-top:50px;">
<input type="hidden" th:value="${session.Id}" id="id"/>
<input type="hidden" th:value="${session.Type}" id="Type"/>

<input type="hidden" th:value="${xiangmuId}" id="xiangmuId">
<input type="hidden" th:value="${xiangmuleixing}" id="xiangmuleixing">
<input type="hidden" th:value="${lunci}" id="lunci">

<div th:replace="public/top_vote::top"></div>

<div id="Votelist">

    <div class="primary-title" >
        <div style="margin-top:5px;text-align: center;font-size:24px">
            <label  style="margin-left: 20px; ">{{xiangmu.xiangmuname}}</label>
            <span  class="btn btn-success" style="float:right;margin-right:15px;margin-top:5px;"
                   v-on:click="toRefresh()">刷新页面</span>
        </div>
        <div style="text-align: center;font-size:18px">

          <label v-if="lunci==1" style="margin-left: 20px;color: red ">您已勾选{{qiyepass}}个生产企业，{{jicaipass}}个集采药，剩余{{jicaishengyu}}个集采药未勾选</label>

            <input v-if="!issubmited" type="button" class="btn btn-sm btn-primary" style="width: 60px" value="提交" @click="tosubmit()">
            <input v-if="issubmited" type="button" class="btn btn-sm btn-success" disabled style="width: 60px" value="已提交" @click="tosubmit()">

            <a v-if="isallsubmited" target="_blank" class='btn btn-primary'
               style='width:120px;height:34px;color:#fff !important;'
               :href="'/main/huizongbiao?xiangmuid='+xiangmuId" >查看汇总表</a>
        </div>

        <div style="text-align: center;font-size:18px;padding-top: 5px">

            <label  style="margin-left: 20px;">规格序号：</label>
            <input type="text" class="form-control" style="width: 150px;display:inline-block;"  v-model="guigexuhao"  >
            <label  style="margin-left: 20px;">药品名称：</label>
            <input type="text" class="form-control" style="width: 150px;display:inline-block;"  v-model="drugname"  >
            <label  style="margin-left: 20px;">基药：</label>
            <select style="width: 70px" class="select-form-control" v-model="jiyao">
                <option value="">-- 请选择 --</option>
                <option value="是">是</option>
                <option value="否">否</option>
            </select>
            <label  style="margin-left: 20px;">集采药：</label>
            <select style="width: 70px" class="select-form-control" v-model="jicaiyao">
                <option value="">-- 请选择 --</option>
                <option value="是">是</option>
                <option value="否">否</option>
            </select>

            <button class="btn btn-info" @click="findBiaojuelist()" style="margin-left:15px;">查询</button>
            <button class="btn btn-danger" @click="remove()" style="margin-left:15px;">重置</button>
            <button class="btn btn-default" @click="votejicai()" style="margin-left:15px;">一键勾选集采药</button>
        </div>
    </div>

    <div style="height: 100px"></div>

    <div class="primary-content">

        <div id="List" >
        </div>

        <div v-if="!show" style="text-align:center;width:100%;">查无数据</div>

        <div v-if="show" class="my-page-navigation">
            <button class="btn btn-default" v-on:click="SetPageIndex">首页</button>
            <button class="btn btn-default" v-on:click="SetPageIndexPrePage">上一页</button>
            <span v-text="pageIndex + '  /  ' + pageCount"></span>
            <span v-text="'共' + recordCount + '条品规'"></span>
            <button class="btn btn-default" v-on:click="SetPageIndexNextPage">下一页</button>
            <button class="btn btn-default" v-on:click="SetPageEnd">尾页</button>
            <span>跳到第</span>
            <input type="text" class="form-control" style="width: 80px;display:inline-block;"  v-model="inputPageIndexValue" v-on:keyup.enter="JumpPage">
            <span>页</span>
            <button class="btn btn-default" v-on:click="JumpPage">跳</button>
        </div>

    </div>

</div>

</body>

<script th:src="@{/js/vote/list_shengchanqiyelinxuan_vote.js?v=1.05}"></script>

<script type="text/javascript">

    var ID = $("#id").val();
    $(function() {
        if(ID==""){
            alert("请先登录！");
            location.href='../main/login';
        }
    });

    function toVote(ppId,ppPinzhong,ppPingui){
        var ppResult="";
        if($("#checkbox_"+ppId).is(":checked")){
            ppResult="1";
        }else {
            ppResult="0";
        }
        layer.open({type: 3});
        $.post('/shengchanqiyetoupiao/vote', {
            id: ppId,
            pinzhong:ppPinzhong,
            pingui:ppPingui,
            lunci:$("#lunci").val(),
            userid:$("#id").val(),
            result: ppResult,
            rdm: Math.random()
        }, function (ppData) {
            layer.closeAll("loading");
            if (ppData != null) {
                if (ppData.result == "1") {
                    vote.getResultCount();
                } else {
                    layer.alert(ppData.message);
                    $("#div_"+ppId).html("<input onclick=\"toVote('"+ppId+"','"+ppPinzhong+"','"+ppPingui+"')\" id='checkbox_"+ppId+"' class='cbcss' type=\"checkbox\">");
                }
            }
        }, "json");

    }

</script>

<style>
    table{
        border:1px solid #e6e6e6;
        /*line-height: 5vh;*/
        color:#666666;
        font-size: 16px;
    }
    table {
        border-collapse: collapse;
        width: 100%;
    }
    td {
        padding:5px;
        border:1px solid #e6e6e6;
        font-size: 14px;
    }
    .table-head{padding-right:17px;background-color: #CDCDCD;color:#000;height:135px;}
    .table-body{width:100%; height:500px;overflow-y:scroll;}
    .table-head table,.table-body table{width:100%;}
    .table-body table tr:nth-child(2n+1){background-color:lightblue}

    .table-body table tr:hover {
        background-color:#dff0d8;
        transition: .2s;
    }
    .table-body table tr:hover td{background-color:rgb(240, 249, 228);}

    a {
        text-decoration: none;
        color:#333;
    }
    /*正常的未被访问过的链接*/
    a:link {
        text-decoration: none;
    }
    /*已经访问过的链接*/
    a:visited {
        text-decoration: none;
    }
    /*鼠标划过(停留)的链接*/
    a:hover {
        text-decoration: none;
    }
    /* 正在点击的链接*/
    a:active {
        text-decoration: none;
    }

    .tt {
        width: 100%;
        position: fixed;
    }

    .select-form-control {
        height: 34px;
        padding: 6px 12px;
        font-size: 14px;
        line-height: 1.42857143;
        color: #555;
        background-color: #fff;
        background-image: none;
        border: 1px solid #ccc;
        border-radius: 4px;
        -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
        -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
        transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    }

</style>

</html>